<!DOCTYPE html>
<html>
<head>
	<title>美丽说商品页</title>
	<link rel="stylesheet" href="./Public/Home/style/css/shop.css">
	<link rel="stylesheet" href="./Public/Home/style/css/font.css">
	<link rel="stylesheet" href="./Public/Home/style/css/index.css">
		<!-- 载入hdjs 气泡报错-->
	<link rel="stylesheet" href="./Public/hdjs/hdjs.css">
	<script src="./Public/jquery-1.8.2.min.js"></script>
	<script src="Public/hdjs/hdjs.min.js"></script>
	<script type="text/javascript" src="./Public/Home/style/js/index.js"></script>
	<script>
		$(function(){
			$(".sshow_c5d1r li").click(function(){

				$(this).addClass('red').siblings().removeClass('red');
				//li标签的属性
				var lilen=$('.sshow_c5d1r ul').length;
				var redLen=$('.red').length;
				if(lilen==redLen){
					var str='';
					$.each($('.red'),function(k,v){
						str += $(this).attr('specId')+',';
					})
					$.ajax({
	   	  			type:"post",
	   	  			url:"<?php echo U('Shop/getAttr')?>",
	   	  			data:{combo : str},
	   	  			dataType:'json',

	   	  			success:function(phpData){
	   	  				var attr="";
	   	  				if(phpData){
	   	  					attr+=phpData.glstock;
	   	  				}else{
	   	  					attr+=0;
	   	  				}
	   	  				
	   	  				$(".attr").html(attr);
	   	  			}

	   	  		})
					
				}

			})
;
		})
	</script>
<!-- 加入购物车 -->
<script>
	$(function(){
		$('.sshow_c7l,.sshow_c7r').click(function(){

			var stock=$('.attr').html();
			// alert(1);
			if(stock != 0){
				// 压入名称、价格、组合货品属性、数量
				var cartname=$('.sshow_c1 h1').html();
				var gid=$('.sshow_c1 h1').attr('gid');
				console.log(gid);
				// console.log(cartname);
				var cartprice=$('.sshow_c2s1').html();
				// console.log(cartprice);
				var lilen=$('.sshow_c5d1r ul').length;
				var redLen=$('.red').length;
				var str='';
				if(lilen==redLen){
					$.each($('.red'),function(k,v){
						str += $(this).attr('specId')+',';
					})
				}else{
					str='';
				}
				// console.log(str);
				var cartnum=$('.num_input').val();
				// console.log(cartnum);
				if($(this).attr('class')=='sshow_c7r'){
					$.ajax({
						type:"post",
						url:"<?php echo U('Cart/getCart')?>",
						data:{cartname:cartname,cartprice:cartprice,str:str,cartnum:cartnum,gid:gid},
						dataType:'text',
						success:function(phpData){
							hd_confirm({message:'添加到购物车成功，是否进入购物车？',success:function(){
								location.href="<?php echo U('Cart/index')?>"
							}});

						}
					})
				}else{
					$.ajax({
						type:"post",
						url:"<?php echo U('Cart/getCart')?>",
						data:{cartname:cartname,cartprice:cartprice,str:str,cartnum:cartnum,gid:gid},
						dataType:'text',
						success:function(phpData){
							hd_confirm({message:'是否立即购买？',success:function(){
								location.href="<?php echo U('Form/index')?>"
							}});

						}
					})
				}
				

			}
			else{
				hd_confirm({message:'该商品没有库存，请重新添加！'
						});
			}
			
		})
	})
</script>
</head>
<body>
	<!-- 头部 -->
	<div id="top">
		<div id="top1">
			<div class="top1_l">
				<i class="iconfont" style="color:#919290;">&#xe602;</i>
				<span>美丽说首页</span>
			</div>
			<ul class="top1_r">
				<?php if(isset($_SESSION['username'])): ?>
                    
                <li class="top1_r1" style="width:50px;">
                    <div class="">
                    <span class="top_a"><?php echo $_SESSION['username']; ?> </span>
                    </div></li>
                <li class="top1_r1">
                    <div class="top0 top5">
                    <a href="<?php echo U('Member/out')?>" class="top_a">退出</a>
                    </div>
                    </li>
                 <?php else: ?>
                     <li class="top1_r1">
                <div class="">
                <a href="<?php echo U('Member/reg')?>" class="top_a">注册</a>
                </div></li>
            <li class="top1_r1">
                <div class="">
                <a href="<?php echo U('Member/login')?>" class="top_a">登录</a></div></li>
                <?php endif ?>
				
				<li class="top1_r2">
					<i class="iconfont" style="color:#ff6699;">&#xe601;</i>
					我的订单
				</li>
				<li class="top1_r2">
					<i class="iconfont" style="color:#ff6699;">&#xe604;</i>
					<a href="<?php echo U('Cart/index',array('goods_gid'=>$_GET['gid']))?>">购物车</a>
				</li>
				<li class="top1_r2">客户服务</li>
				<li class="top1_r2">商家后台</li>
			</ul>
		</div>
	</div>
	<!-- 搜索框 -->
	<div id="ipt">
		<div id="ipt1">
			<div class="ipt1_l">
				<div class="ipt1_ll">
					<img src="./Public/Home/style/images/mls8.jpg">
				</div>
				<div class="ipt1_lc">
					<div class="ipt1_lct">
						<span>cici-shop官方旗舰店</span>
						<img src="./Public/Home/style/images/mls6.png">
					</div>
					<p class="ipt1_lcb">
						<span>
							描述
							<b>4.78</b>
						</span>
						<span>
							描述
							<b  style="color:#ef2f23;">4.78</b>
						</span>
						<span>
							描述
							<b>4.78</b>
						</span>
						<span>
							描述
							<b>4.78</b>
						</span>
					</p>
				</div>
				<div class="ipt1_lr">
					<div class="ipt1_lrl">收藏</div>

					<div class="ipt1_lrl">
					<img src="./Public/Home/style/images/mls.gif">
						联系客服
					</div>
				</div>
				<div class="ipt1_lrr"></div>
			</div>
			<div id="ipt2">
				<input type="text" name="" class="ipt2_l" placeholder="输入你想搜索的内容" style="outline:none;">
				<input type="submit" value="搜全站" name="" class="ipt2_c" style="outline:none;">
				<input type="submit" value="搜全部" name="" class="ipt2_r" style="outline:none;">
			</div>
		</div>
	</div>
	<!-- 品牌显示 -->
	<div id="bran_h"></div>
	<div id="brand0">
	<div id="brand">

		<div id="brand1">
			<ul>
				<li style="width:69px;">
					<div class="brand1" style="width:69px;">
						<a href="">首页</a>
					</div>
				</li>
				<li class="brand1_l" style="width:120px;">
					<div class="brand1" style="width:120px;">
						<a href="">全部商品</a>
					</div>
					<div class="brand1_h">
						<dd>
							<dt><a href=""><div class="brand1_h1"><span>> </span>NEW每周上新</div></a></dt>
							<dt><a href=""><span>> </span>NEW每周上新</a></dt>
							<dt><a href=""><span>>	</span>NEW每周上新</a></dt>
							<dt><a href=""><span>>	</span>NEW每周上新</a></dt>
							<dt><a href=""><span>>	</span>NEW每周上新</a></dt>
							<dt><a href=""><span>>	</span>NEW每周上新</a></dt>
							<dt><a href=""><span>>	</span>NEW每周上新</a></dt>
							<dt><a href=""><span>>	</span>NEW每周上新</a></dt>
							<dt><a href=""><span>>	</span>NEW每周上新</a></dt>
							<dt><a href=""><span>>	</span>NEW每周上新</a></dt>
							<dt><a href=""><span>>	</span>NEW每周上新</a></dt>
							<dt><a href=""><span>>	</span>NEW每周上新</a></dt>
						</dd>
					</div>
				</li>
				<li style="width:153px;">
					<div class="brand1" style="width:153px;">
						<a href="">每周上新7.14！！</a>
					</div>
				</li>
				<li style="width:132px;">
					<div class="brand1" style="width:132px;">
						<a href="">CHOK清仓特惠</a>
					</div>
				</li>
				<li style="width:113px;">
					<div class="brand1" style="width:113px;">
						<a href="">NICE连衣裙</a>
					</div>
				</li>
				<li style="width:121px;">
					<div class="brand1" style="width:121px;">
						<a href="">SKIRT半身裙</a>
					</div>
				</li>
				<li style="width:107px;">
					<div class="brand1" style="width:107px;">
						<a href="">T-shirt.T恤</a>
					</div>
				</li>
				<li style="width:95px;">
					<div class="brand1" style="width:95px;">
						<a href="">TOP上装</a>
					</div>
				</li>
				<li style="width:132px;">
					<div class="brand1" style="width:132px;">
						<a href="">BOTTOMS下装</a>
					</div>
				</li>
				<li style="width:125px;">
					<div class="brand1" style="width:125px;">
						<a href="">单品热销推荐</a>
					</div>
				</li>
			</ul>
		</div>
	</div>	
	</div>
	<!-- //商品展示 -->
	<div id="sshow">
		<div id="sshow_l">

			<div class="sshow_lt">
				<img class="sshow_lti" src="./Public/Home/style/images/mls10.jpg">
				<img class="sshow_lti" src="./Public/Home/style/images/mls12.jpg">
			</div>
			<div class="sshow_lb">
				<ul>
					<li class="sshow1"><img  src="./Public/Home/style/images/mls11.jpg"></li>
					<li class="sshow1"><img  src="./Public/Home/style/images/mls12.jpg"></li>
				</ul>
			</div>
		</div>
		<div id="sshow_c">
			<div class="sshow_c1">
				<h1 gid=<?php echo $_GET['gid']?>><?php echo $goodsData['gname']?></h1>

			</div>
			<div class="sshow_c2">
				<ul>
					<li >
						<div class="sshow_c2d1">价格：</div>
						<span>￥<?php echo $goodsData['marketprice']?></span>
					</li>
					<li>
						<div class="sshow_c2d2">促销价：</div>
						<span class="sshow_c2s1">￥<?php echo $goodsData['shopprice']?></span>
					</li>	
								
				</ul>
				
			</div>
			<div class="sshow_c3">
					<div class="sshow_c3d1">
						<div class="sshow_c3d1l">客服:</div>
						<div class="sshow_c3d1r">
							<img src="./Public/Home/style/images/mls.gif">
							联系客服
						</div>
					</div>
				</div>
				<div class="sshow_c4">
					<div class="sshow_c4d1l">款式:</div>
					<div class="sshow_c4d1r">
						<img src="./Public/Home/style/images/mls13.jpg">
						<div class="sshow_c4d1rm">
							<img src="./Public/Home/style/images/mls7.png">
						</div>
					</div>
				</div>
				<?php foreach ($conAttr as $v){?>

				<div class="sshow_c5">
					<div class="sshow_c5d1l"><?php echo $v['name']?>:</div>
					<div class="sshow_c5d1r">
						<ul class="sshow_c5d1ru">
						<?php foreach ($v['value'] as $value){?>
							<li specId="<?php echo $value['gtid']?>"><?php echo $value['gtvalue']?></li>
						<?php }?>
							
						</ul>
					</div>
				</div>
				<?php }?>
				<div class="sshow_c6">
					<div class="sshow_c6d1l">数量:</div>
					<script>
						$(function(){
							$('.min').click(function(){
								var num=parseInt($(".num_input").val())||0;
								num=num-1;
								num=num<1 ? 1:num;
								$(".num_input").val(num);
							})
							$('.max').click(function(){
								var num=parseInt($(".num_input").val())||0;
								$(".num_input").val(num+1);
							})
						})
					</script>
					<div class="sshow_c6d1r">
						<span class="min">-</span>
						<input type="text" value="1" class="num_input">
						<span class="max">+</span>
						<div class="sshow_c6d1r1">库存<div class="attr" style="display:inline-block;">0</div>件</div>
					</div>
					
				</div>
				<div class="sshow_c7">
					<div class="sshow_c7l"><span>立即购买</span></div>

					

					<div class="sshow_c7r"><span>加入购物车</span></div>
				</div>
				<div class="sshow_c8">
					<div class="sshow_c8l"><span>立即购买</span></div>
					<div class="sshow_c8r"><span>加入购物车</span></div>
				</div>
				<div class="sshow_c9">
					<div class="sshow_c9d1l">服务承诺:</div>
					<div class="sshow_c9d1r">
						<span>
							<i class="iconfont">&#xe604;</i>
							退货补运费
						</span>
					</div>
					<div class="sshow_c9d1r">
						<span>
							<i class="iconfont">&#xe604;</i>
							7天无理由退货
						</span>
					</div>
					<div class="sshow_c9d1r">
						<span>
							<i class="iconfont">&#xe604;</i>
							先行赔付
						</span>
					</div>
					<div class="sshow_c9d1r">
						<span>
							<i class="iconfont">&#xe604;</i>
							72小时发货
						</span>
					</div>
				</div>
		</div>
		
		<div id="sshow_r">
			<div class="sshow_r1">
				-<span>热卖推荐</span>-
			</div>
			<ul class="sshow_r1">
				<li class="sshow_r2">
					<a href="">
						<img src="./Public/Home/style/images/mls14.jpg" alt="">
					</a>

					<span>￥99.00</span>
				</li>
				<li class="sshow_r2">
					<a href="">
						<img src="./Public/Home/style/images/mls14.jpg" alt="">
					</a>

					<span>￥99.00</span>
				</li>
				<li class="sshow_r2">
					<a href="">
						<img src="./Public/Home/style/images/mls14.jpg" alt="">
					</a>

					<span>￥99.00</span>
				</li>
			</ul>
		</div>
	</div>
	<!-- //商品详情 -->
	<div id="detail">
		<div id="detail_l">
			<div class="detail_lt">
				<span>看了又看</span>

			</div>
			<div class="detail_lc">
				<a class="detail_lct" href=""><img src="./Public/Home/style/images/mls15.jpg" alt=""></a>
				<div class="detail_lcc"><a hre="">单排流苏不规则牛仔</a></div>
				<div class="detail_lcc">
					<div class="detail_lccl">
						<span>￥99.00</span>
					</div>
					<div class="detail_lccr">
						<i class="iconfont">&#xe608;</i>
						<span>1957</span>
					</div>
				</div>
			</div>
			<div class="detail_lc">
				<a class="detail_lct" href=""><img src="./Public/Home/style/images/mls15.jpg" alt=""></a>
				<div class="detail_lcc"><a hre="">单排流苏不规则牛仔</a></div>
				<div class="detail_lcc">
					<div class="detail_lccl">
						<span>￥99.00</span>
					</div>
					<div class="detail_lccr">
						<i class="iconfont">&#xe608;</i>
						<span>1957</span>
					</div>
				</div>
			</div>
			<div class="detail_lc">
				<a class="detail_lct" href=""><img src="./Public/Home/style/images/mls15.jpg" alt=""></a>
				<div class="detail_lcc"><a hre="">单排流苏不规则牛仔</a></div>
				<div class="detail_lcc">
					<div class="detail_lccl">
						<span>￥99.00</span>
					</div>
					<div class="detail_lccr">
						<i class="iconfont">&#xe608;</i>
						<span>1957</span>
					</div>
				</div>
			</div>
			<div class="detail_lc">
				<a class="detail_lct" href=""><img src="./Public/Home/style/images/mls15.jpg" alt=""></a>
				<div class="detail_lcc"><a hre="">单排流苏不规则牛仔</a></div>
				<div class="detail_lcc">
					<div class="detail_lccl">
						<span>￥99.00</span>
					</div>
					<div class="detail_lccr">
						<i class="iconfont">&#xe608;</i>
						<span>1957</span>
					</div>
				</div>
			</div>
		</div>



		<div id="detail_c">
			<div class="detail_ct">
				<ul>
					<li >
						<a href="">商品详情</a>
					</li>
					<li >
						<a href="">累计评价</a>
					</li>
					<li >
						<a href="">本店同类商品</a>
					</li>
				</ul>
			</div>
			<div class="detail_c1">
				<h2>
					商品描述
				</h2>
			</div>
			<div class="detail_c2">
				<h2>
					!
				</h2>
			</div>
			<div class="detail_c3">
				<h2>
					产品参数
				</h2>
			</div>
			<div class="detail_c4">
				<table>
					<tr class="detail_c4tr">
						<td class="detail_c4td"><span>袖型:牛角袖</span></td>
						<td class="detail_c4td"><span>袖型:牛角袖</span></td>
						<td class="detail_c4td"><span>袖型:牛角袖</span></td>
					</tr>
					<tr class="detail_c4tr">
						<td class="detail_c4td"><span>袖型:牛角袖</span></td>
						<td class="detail_c4td"><span>袖型:牛角袖</span></td>
						<td class="detail_c4td"><span>袖型:牛角袖</span></td>
					</tr>
					<tr class="detail_c4tr">
						<td class="detail_c4td"><span>袖型:牛角袖</span></td>
						<td class="detail_c4td"><span>袖型:牛角袖</span></td>
						<td class="detail_c4td"><span>袖型:牛角袖</span></td>
					</tr>
					<tr class="detail_c4tr">
						<td class="detail_c4td"><span>袖型:牛角袖</span></td>
						<td class="detail_c4td"><span>袖型:牛角袖</span></td>
						<td class="detail_c4td"><span>袖型:牛角袖</span></td>
					</tr>
					<tr class="detail_c4tr">
						<td class="detail_c4td"><span>袖型:牛角袖</span></td>
					</tr>
				</table>
			</div>
			<div class="detail_c5">
				<h2>
					产品参数
				</h2>
			</div>
			<div class="detail_c6">
				<img src="./Public/Home/style/images/mls17.jpg" alt="">
			</div>
			<!-- <div class="detail_c7">
				<h2>
					产品参数
				</h2>
			</div>
			<div class="detail_c8">
				<img src="style/images/mls17.jpg" alt="">
			</div> -->
			<div class="detail_c9">
				<h2>
					尺码说明
				</h2>
			</div>

			<div class="detail_c10">
				<table>
					<tr class="detail_c10tr" style="background:#F2F2F2;">
						<td class="detail_c10td"><span>袖型:牛角袖</span></td>
						<td class="detail_c10td"><span>袖型:牛角袖</span></td>
					</tr>
					<tr class="detail_c10tr">
						<td class="detail_c10td"><span>袖型:牛角袖</span></td>
						<td class="detail_c10td"><span>袖型:牛角袖</span></td>
					</tr>
					<tr class="detail_c10tr">
						<td class="detail_c10td"><span>袖型:牛角袖</span></td>
						<td class="detail_c10td"><span>袖型:牛角袖</span></td>
					</tr>
					<tr class="detail_c10tr">
						<td class="detail_c10td"><span>袖型:牛角袖</span></td>
						<td class="detail_c10td"><span>袖型:牛角袖</span></td>
					</tr>
					<tr class="detail_c10tr">
						<td class="detail_c10td"><span>袖型:牛角袖</span></td>
						<td class="detail_c10td"><span>袖型:牛角袖</span></td>
					</tr>
				</table>
			</div>

			<div class="detail_c11">
				<span>※ 以上尺寸为实物人工测量，因测量当时不同会有1-2cm误差，相关数据仅作参考，以收到实物为准。</span>
			</div>
		</div>
		<div id="detail_r">
			<div class="detail_r1">
				<span>加入购物车</span>
			</div>
			<div class="detail_r2">
				<ul>
					<li>
						<a href="" style="background-image:none">▶商品描述</a>
					</li>
					<li>
						<a href="">▶商品描述</a>
					</li>
					<li>
						<a href="" style="color:red;">▶细节描述</a>
					</li>
					<li>
						<a href="">▶商品描述</a>
					</li>
					<li>
						<a href="">▶商品描述</a>
					</li>
					<li>
						<a href="">▶商品描述</a>
					</li>
				</ul>
			</div>
		</div>
	</div>
	<!-- 站点配置 -->
	<div id="web" style="margin-top:750px;background:#FBFBFB;border-top:1px solid #ccc;">
		<span>Copyright ©2016 Meilishuo.com</span>
		<a href=""> 电信与信息服务业务经营许可证100798号</a>
		<a href="">经营性网站备案信息</a>
		<span>京ICP备11031139号</span>
		<span>京公网安备110108006045</span>
	</div>

</body>
</html>